package com.qianyanglong.m3u8.frame;

import com.qianyanglong.m3u8.listner.HomeComponentListener;
import com.qianyanglong.m3u8.model.M3U8TableModel;
import com.qianyanglong.m3u8.table.M3U8Table;

import javax.swing.*;
import javax.swing.border.LineBorder;
import java.awt.*;

public class HomeFrame extends JFrame {

    public HomeFrame(){
        setTitle("天下无敌的m3u8下载工具");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLayout(null);
        setSize(1000,500);
        setLocationRelativeTo(null);

        String[] columnNames = new String[]{"序号","文件名","地址","状态","进度","操作"};
        M3U8TableModel m3U8TableModel = new M3U8TableModel(columnNames);
        M3U8Table m3U8Table = new M3U8Table(m3U8TableModel);
        JScrollPane m3u8TableScrollPane = new JScrollPane(m3U8Table);
        m3u8TableScrollPane.setBorder(new LineBorder(Color.BLACK));
        m3u8TableScrollPane.setBounds(10,10,980,480);
        add(m3u8TableScrollPane);

        //setExtendedState(JFrame.MAXIMIZED_BOTH);
        addComponentListener(new HomeComponentListener(m3U8Table, m3u8TableScrollPane));
        setVisible(true);
    }

}
